<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改题目')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-question-edit" th:object="${question}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">题目名称：</label>
                <div class="col-sm-8">
                    <textarea name="title" class="form-control" th:field="*{title}" ></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">题库分类：</label>
                <div class="col-sm-8">
                    <span name="typeName" th:text="*{typeName}" class="form-control" type="text"></span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">类型：</label>
                <div class="col-sm-8">
                    <select name="questionType" class="form-control m-b" th:with="type=${@dict.getType('tb_question_type')}"  th:field="*{questionType}" disabled>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label">A：</label>
                <div class="col-sm-8">
                    <input name="answerA" th:field="*{answerA}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">B：</label>
                <div class="col-sm-8">
                    <input name="answerB" th:field="*{answerB}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">C：</label>
                <div class="col-sm-8">
                    <input name="answerC" th:field="*{answerC}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">D：</label>
                <div class="col-sm-8">
                    <input name="answerD" th:field="*{answerD}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">答案：</label>
                <div class="col-sm-8">
                    <input name="answer" class="form-control" th:field="*{answer}" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">解析：</label>
                <div class="col-sm-8">
                    <textarea name="introduce" class="form-control" th:field="*{introduce}" rows="6"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">分数：</label>
                <div class="col-sm-8">
                    <input name="score" th:field="*{score}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "module/question";
        $("#form-question-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.modal.close();
            }
        }
    </script>
</body>
</html>